package it.mp.acquaalta;

import java.net.URL;
import it.mp.acquaalta.widget.R;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.view.Window;
import android.widget.ImageView;
import android.widget.Toast;

public class AcquaAltaGrafico extends Activity {
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.acquaalta_grafico);
		URL url;
		try {
			url = new URL("http://www.comune.venezia.it/flex/AppData/Local/bollettino_grafico.jpg");
			Bitmap bmp = BitmapFactory.decodeStream(url.openStream());
			((ImageView) findViewById(R.id.IV_grafico)).setImageBitmap(bmp);
		} catch (Exception e) {
			Toast.makeText(this, "Errore nel caricamento del grafico!", Toast.LENGTH_SHORT).show();
			e.printStackTrace();
			finish();
		}
	}

}
